package com.atguigu.cms.controller;

import com.atguigu.cms.entity.CrmBanner;
import com.atguigu.cms.service.CrmBannerService;
import com.atguigu.commonutils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 首页banner表 前台banner显示 前端控制器
 * </p>
 *
 * @author jyd
 * @since 2022-03-27
 */
@RestController
//@CrossOrigin
@RequestMapping("/educms/banner")
public class CrmBannerFrontController {
    @Autowired
    private CrmBannerService bannerService;
    //查询所有banner
    @GetMapping("getAllBanner")
    public R getBanner(){
        List<CrmBanner> bannerList = bannerService.selectBanner();
        System.out.println(bannerList);
        return R.ok().data("list",bannerList);
    }

}
